package com.sxt.feign.core.test;

import com.sxt.feign.core.anno.HystixCmdRpc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * @author LSX
 * @create 2019/8/23
 */
@Service
public class RpcServiceImpl  implements RpcService {

    @Autowired
    private RestTemplate restTemplate;

    @HystixCmdRpc(callback = RpcFailBack.class)
    public String rpc() {
        String url ="http://localhost:8081/info";
        String result = restTemplate.getForObject(url, String.class);
        return result;
    }

}
